' rem the next line when compiling the final door !!!
' test%=1
'
cr$=CHR$(13)+CHR$(10)
de$=CHR$(8)+" "+CHR$(8)
esc$=CHR$(27)
screenclr$=cr$+cr$+CHR$(12)
'
IF (test%=1) AND (NOT EXIST("Ram:Userdata"))
' setup dummy names, etc
rtime$="300"
uname$="PETER DEANE"
id$="1"
lev$="1"
bd$="2400"
ring$="0"
ansi%=1
path$="BBS:Doorfiles1/Door211/"
ELSE
IF EXIST("ram:doordata")
OPEN "I",#2,"RAM:USERDATA"
LINE INPUT #2,rtime$
LINE INPUT #2,uname$
LINE INPUT #2,id$
LINE INPUT #2,lev$
LINE INPUT #2,bd$
LINE INPUT #2,ring$
LINE INPUT #2,path$
CLOSE #2
ELSE
'
' THIS door WON'T work without doordata!!
END
'
ENDIF
ENDIF
'
' Investigate our working environment from the config file...
'
IF EXIST("S:Metro.cfg")
config$="S:Metro.cfg"
ELSE IF EXIST("BBS:Metro.cfg")
config$="BBS:Metro.cfg"
ELSE IF EXIST("Metro.cfg")
config$="Metro.cfg"
ELSE
config$="XXX"
ENDIF
'
' Defaults
'
bbsname$="The OzMetro BBS"
sfd$="BBS:"
sysopname$="The Sysop"
winw$="640"
winh$="200"
'
IF config$<>"XXX"
'
OPEN "I",#2,config$,128
DO WHILE (NOT EOF(#2))
LINE INPUT #2,xx$
xx$=TRIM$(xx$)
xxu$=UPPER$(xx$)
'
IF xxu$="" OR LEFT$(xxu$,1)=";"
' Do nothing
ELSE IF LEFT$(xxu$,7)="BBSNAME"
xx$=MID$(xx$,8,255)
xx$=TRIM$(xx$)
bbsname$=xx$
ELSE IF LEFT$(xxu$,9)="SYSOPNAME"
xx$=MID$(xx$,10,255)
xx$=TRIM$(xx$)
sysopname$=xx$
ELSE IF LEFT$(xxu$,11)="WINDOWWIDTH"
xx$=MID$(xx$,12,255)
xx$=TRIM$(xx$)
winw$=xx$
ELSE IF LEFT$(xxu$,12)="WINDOWHEIGHT"
xx$=MID$(xx$,13,255)
xx$=TRIM$(xx$)
winh$=xx$
ENDIF
'
LOOP UNTIL EOF(#2)
CLOSE #2
ENDIF
'
' integer conversion for system variables
'
tpc%=VAL(rtime$)
id%=VAL(id$)
lev%=VAL(lev$)
ring%=VAL(ring$)
bd%=VAL(bd$)
timeon%=CINT(TIMER/200)
'
sw%=VAL(winw$)
sh%=VAL(winh$)
sx%=0
sy%=0
ww%=sw%
wh%=sh%-12
wx%=0
wy%=11
'
'
OPENS 1,sx%,sy%,sw%,sh%,3,32768
IF ring%=1
BACKS 1
OPENW #1,wx%,wy%,ww%,wh%,0,2304,1
ELSE
OPENW #1,wx%,wy%,ww%,wh%,0,2304,1
~ActivateWindow(WINDOW(1))
ENDIF
'
' Hack these settings if you like: format &Hxxx
' the xxx is the HEX value of the RGB register
'
SETCOLOR 0,&H141
SETCOLOR 1,&HD62
SETCOLOR 2,&H2D2
SETCOLOR 3,&HCB2
SETCOLOR 4,&H56C
SETCOLOR 5,&HB6B
SETCOLOR 6,&H5DC
SETCOLOR 7,&HFEF
'
title$="Time Bank ID: "+id$+" ("+uname$+") Lev: "+lev$+" Baud: "
IF ring%=0
title$=title$+"Local Login"
ELSE
title$=title$+bd$
ENDIF
TITLEW #1,"",title$
TITLES #1,title$
'
' modem need not be opened if it's a local login!
' then you can test em standalone with the BBS running, among other things...
'
IF ring%<>0
GOSUB modem.o
ENDIF
'
' Figure out the page pause setting!
'
flnm$=sfd$+"BBSFILES/userlog"
IF EXIST(flnm$)
OPEN "R",#2,flnm$,125
FIELD #2,25 AS un$,10 AS pa$,1 AS le$,25 AS fr$,12 AS ph$,10 AS dl$,6 AS lm$,6 AS lf$,10 AS ind$,3 AS tc$,3 AS td$,1 AS sw$,1 AS pr$,1 AS mo$,5 AS cn$,4 AS dm1$,2 AS dm2$